<template>
  <div id="app">
    <router-view></router-view>
  </div>
</template>

<script>
export default {
  name: "app",
  // 在页面请求加载完成后再最底层判断是否已经登录成功
  mounted() {
    this.$axios({
      url: "/admin/account/islogin",
      // 由于在8080端口下去请求8899端口，涉及到跨域
      withCredentials: true
    }).then(res => {
      if (res.data.code == "nologin") {
        this.$router.push("/login");
      }
    });
  }
};
</script>

<style>
html,
body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
input,
select,
option,
button,
section,
div,
img {
  margin: 0;
  padding: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

#app {
  width: 100%;
}
</style>
 